import React, { Component } from 'react';

class StockItem extends Component {
  constructor(props) {
    super(props);
    this.handleClick = this.handleClick.bind(this);
  }

  render () {
    return (
      <li
        onClick={this.handleClick}
      >
        {this.props.item}
      </li>
    );
  }
  handleClick () {
    console.log('我必将富有', this.props.index);
    this.props.deleteItem(this.props.index);
  }
}

export default StockItem;
